<?php
$this->pageTitle=Yii::app()->name . ' - Error';

Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl.'/css/common/errorStyle.css');

$arr_code = str_split($code);
?>
<div class = "error_box">
    <p>
        <?php foreach ($arr_code as $value) {?>
        <span class="go3d"><?=$value;?></span>
        <?php }?>
    </p>

    <p class="error">
        <?=CHtml::encode($message);?><br />
        The links below will help you get back on the right path.<br />
        <a href="javascript:getBackURL();">Return to previous Link</a>.
    </p>
</div>

<script type="text/javascript">
function getBackURL()
{
    var URLBack = document.referrer.match(/admin.php\/\w+/g);
    if (typeof URLBack == "undefined" || URLBack == null ) 
    {
        location.replace( '<?=Yii::app()->request->baseUrl;?>');
    }
    else
    {
        window.history.go(-1);
    }
}
</script>
